package com.pth.action;

import com.opensymphony.xwork2.ActionSupport;
import com.pth.exception.MyException;
import com.pth.model.Jianjie;
import com.pth.service.JianjieService;

public class GetSingleJianjieAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public JianjieService getJianjieService() {
		return jianjieService;
	}
	public void setJianjieService(JianjieService jianjieService) {
		this.jianjieService = jianjieService;
	}
	public Jianjie getJianjie() {
		return jianjie;
	}
	public void setJianjie(Jianjie jianjie) {
		this.jianjie = jianjie;
	}
	private int id;
	private JianjieService jianjieService;
	private Jianjie jianjie;
	
	
	@Override
	public String execute() throws Exception {

		MyException myException=new MyException();
		
		jianjie=jianjieService.getJianjieByid(id);
		
		if(jianjie==null){
			
			throw(myException);
			
		}
		
		return SUCCESS;
		
	}
	
}
